Rename test-abi to test-symbols, start verifying symbols are documented
authorColin Walters <walters@verbum.org>
Fri, 15 Apr 2016 19:49:05 +0000 (15:49 -0400)
committerColin Walters (automation) <walters+githubbot@verbum.org>
Sun, 17 Apr 2016 13:52:07 +0000 (13:52 +0000)
We keep forgetting to update `apidoc/ostree-sections.txt`, so let's
start enforcing it.  Of course it turns out we had some bugs here
like symbols marked as public but never implemented, etc.  Those
are fixed in the prior commits.

Closes: #263
Approved by: giuseppe

Makefile-tests.am
apidoc/ostree-sections.txt
src/libostree/libostree.sym
tests/test-abi.sh [deleted file]
tests/test-symbols.sh [new file with mode: 0755]

index b3d751428b6dc632d6663cdc873709fc0131161b..47af9e70549cc2fd37ae2a54908dcc159f08809f 100644 (file)
@@ -28,7 +28,7 @@ TESTS_ENVIRONMENT += OT_TESTS_DEBUG=1 \
        PATH=$$(cd $(top_builddir) && pwd):$${PATH} \
        $(NULL)
 
-uninstalled_test_scripts = tests/test-abi.sh
+uninstalled_test_scripts = tests/test-symbols.sh
 
 test_scripts = \
        tests/test-basic.sh \
index 815b6d47316e4dba619036c372ebfa4f5c68f309..3b185ac0fd1566a66816f2ca92e0ec2822c49ee5 100644 (file)
@@ -27,7 +27,9 @@ OstreeBootconfigParser
 ostree_bootconfig_parser_new
 ostree_bootconfig_parser_clone
 ostree_bootconfig_parser_parse
+ostree_bootconfig_parser_parse_at
 ostree_bootconfig_parser_write
+ostree_bootconfig_parser_write_at
 ostree_bootconfig_parser_set
 ostree_bootconfig_parser_get
 <SUBSECTION Standard>
@@ -97,6 +99,8 @@ ostree_checksum_inplace_from_bytes
 ostree_checksum_inplace_to_bytes
 ostree_checksum_bytes_peek
 ostree_checksum_bytes_peek_validate
+ostree_checksum_b64_inplace_from_bytes
+ostree_checksum_b64_inplace_to_bytes
 ostree_cmp_checksum_bytes
 ostree_validate_rev
 ostree_parse_refspec
@@ -109,6 +113,7 @@ ostree_object_to_string
 ostree_object_from_string
 ostree_content_stream_parse
 ostree_content_file_parse
+ostree_content_file_parse_at
 ostree_raw_file_to_content_stream
 ostree_checksum_file_from_input
 ostree_checksum_file
@@ -140,11 +145,14 @@ ostree_deployment_get_bootcsum
 ostree_deployment_get_bootserial
 ostree_deployment_get_bootconfig
 ostree_deployment_get_origin
+ostree_deployment_get_origin_relpath
+ostree_deployment_get_unlocked
 ostree_deployment_set_index
 ostree_deployment_set_bootserial
 ostree_deployment_set_bootconfig
 ostree_deployment_set_origin
 ostree_deployment_clone
+ostree_deployment_unlocked_state_to_string
 <SUBSECTION Standard>
 OSTREE_DEPLOYMENT
 OSTREE_IS_DEPLOYMENT
@@ -226,6 +234,7 @@ ostree_repo_create
 ostree_repo_get_path
 ostree_repo_get_mode
 ostree_repo_get_config
+ostree_repo_get_dfd
 ostree_repo_copy_config
 ostree_repo_remote_add
 ostree_repo_remote_delete
@@ -237,6 +246,9 @@ ostree_repo_remote_get_gpg_verify
 ostree_repo_remote_get_gpg_verify_summary
 ostree_repo_remote_gpg_import
 ostree_repo_remote_fetch_summary
+ostree_repo_get_remote_boolean_option
+ostree_repo_get_remote_list_option
+ostree_repo_get_remote_option
 ostree_repo_get_parent
 ostree_repo_write_config
 OstreeRepoTransactionStats
@@ -247,6 +259,8 @@ ostree_repo_abort_transaction
 ostree_repo_transaction_set_refspec
 ostree_repo_transaction_set_ref
 ostree_repo_set_ref_immediate
+ostree_repo_set_cache_dir
+ostree_repo_sign_delta
 ostree_repo_has_object
 ostree_repo_write_metadata
 ostree_repo_write_metadata_async
@@ -269,6 +283,8 @@ ostree_repo_load_object_stream
 ostree_repo_query_object_storage_size
 ostree_repo_import_object_from
 ostree_repo_import_object_from_with_trust
+ostree_repo_import_archive_to_mtree
+ostree_repo_export_tree_to_archive
 ostree_repo_delete_object
 OstreeRepoCommitFilterResult
 OstreeRepoCommitFilter
@@ -284,6 +300,7 @@ ostree_repo_commit_modifier_unref
 ostree_repo_devino_cache_new
 ostree_repo_devino_cache_ref
 ostree_repo_devino_cache_unref
+ostree_repo_devino_cache_get_type
 ostree_repo_write_directory_to_mtree
 ostree_repo_write_dfd_to_mtree
 ostree_repo_write_archive_to_mtree
@@ -309,8 +326,16 @@ ostree_repo_static_delta_execute_offline
 ostree_repo_traverse_new_reachable
 ostree_repo_traverse_commit
 ostree_repo_traverse_commit_union
+ostree_repo_commit_traverse_iter_cleanup
+ostree_repo_commit_traverse_iter_clear
+ostree_repo_commit_traverse_iter_get_dir
+ostree_repo_commit_traverse_iter_get_file
+ostree_repo_commit_traverse_iter_init_commit
+ostree_repo_commit_traverse_iter_init_dirtree
+ostree_repo_commit_traverse_iter_next
 OstreeRepoPruneFlags
 ostree_repo_prune
+ostree_repo_prune_static_deltas
 OstreeRepoPullFlags
 ostree_repo_pull
 ostree_repo_pull_one_dir
@@ -318,6 +343,7 @@ ostree_repo_pull_with_options
 ostree_repo_pull_default_console_progress_changed
 ostree_repo_sign_commit
 ostree_repo_append_gpg_signature
+ostree_repo_add_gpg_signature_summary
 ostree_repo_verify_commit
 ostree_repo_verify_commit_ext
 ostree_repo_verify_summary
@@ -364,8 +390,11 @@ ostree_sepolicy_new
 ostree_sepolicy_get_path
 ostree_sepolicy_get_name
 ostree_sepolicy_get_label
+ostree_sepolicy_get_csum
 OstreeSePolicyRestoreconFlags
 ostree_sepolicy_restorecon
+ostree_sepolicy_setfscreatecon
+ostree_sepolicy_fscreatecon_cleanup
 <SUBSECTION Standard>
 OSTREE_SEPOLICY
 OSTREE_IS_SEPOLICY
@@ -386,6 +415,7 @@ ostree_sysroot_try_lock
 ostree_sysroot_lock_async
 ostree_sysroot_lock_finish
 ostree_sysroot_unlock
+ostree_sysroot_unload
 ostree_sysroot_get_fd
 ostree_sysroot_ensure_initialized
 ostree_sysroot_get_bootversion
@@ -393,13 +423,17 @@ ostree_sysroot_get_subbootversion
 ostree_sysroot_get_deployments
 ostree_sysroot_get_booted_deployment
 ostree_sysroot_get_deployment_directory
+ostree_sysroot_get_deployment_dirpath
 ostree_sysroot_get_deployment_origin_path
 ostree_sysroot_cleanup
 ostree_sysroot_prepare_cleanup
 ostree_sysroot_get_repo
 ostree_sysroot_init_osname
 ostree_sysroot_deployment_set_kargs
+ostree_sysroot_deployment_set_mutable
+ostree_sysroot_deployment_unlock
 ostree_sysroot_write_deployments
+ostree_sysroot_write_origin_file
 ostree_sysroot_deploy_tree
 ostree_sysroot_get_merge_deployment
 ostree_sysroot_origin_new_from_refspec
index 89a1457ec12d8e7976a3c173e1af87ca7b2e2e59..8c0d8389d916819ee4858263035a6e2eeb4336bd 100644 (file)
@@ -323,11 +323,6 @@ global:
         ostree_deployment_unlocked_state_to_string;
 } LIBOSTREE_2016.3;
 
-/*                         NOTE NOTE NOTE
- * Versions above here are released.  Only add symbols below this line.
- *                         NOTE NOTE NOTE
- */
-
 LIBOSTREE_2016.5 {
 global:
         ostree_repo_import_object_from_with_trust;
@@ -337,3 +332,8 @@ global:
         ostree_repo_get_remote_boolean_option;
         ostree_repo_set_cache_dir;
 } LIBOSTREE_2016.4;
+
+/*                         NOTE NOTE NOTE
+ * Versions above here are released.  Only add symbols below this line.
+ *                         NOTE NOTE NOTE
+ */
diff --git a/tests/test-abi.sh b/tests/test-abi.sh
deleted file mode 100755 (executable)
index 62af365..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/bash
-#
-# Copyright (C) 2016 Colin Walters <walters@verbum.org>
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the
-# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-
-set -euo pipefail
-
-echo '1..1'
-
-grep ' ostree_[A-Za-z0-9_]*;' ${G_TEST_SRCDIR}/src/libostree/libostree.sym | sed -e 's,^ *\([A-Za-z0-9_]*\);,\1,' | sort -u > expected-symbols.txt
-eu-readelf -a ${G_TEST_BUILDDIR}/.libs/libostree-1.so | grep 'FUNC.*GLOBAL.*DEFAULT.*@@LIBOSTREE_' | sed -e 's,^.* \(ostree_[A-Za-z0-9_]*\)@@LIBOSTREE_[0-9_.]*,\1,' |sort -u > found-symbols.txt
-diff -u expected-symbols.txt found-symbols.txt
-
-echo 'ok'
diff --git a/tests/test-symbols.sh b/tests/test-symbols.sh
new file mode 100755 (executable)
index 0000000..55157c0
--- /dev/null
@@ -0,0 +1,37 @@
+#!/bin/bash
+#
+# Copyright (C) 2016 Colin Walters <walters@verbum.org>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+set -euo pipefail
+
+echo '1..2'
+
+echo "Verifying all expected symbols are actually exported..."
+grep ' ostree_[A-Za-z0-9_]*;' ${G_TEST_SRCDIR}/src/libostree/libostree.sym | sed -e 's,^ *\([A-Za-z0-9_]*\);,\1,' | sort -u > expected-symbols.txt
+eu-readelf -a ${G_TEST_BUILDDIR}/.libs/libostree-1.so | grep 'FUNC.*GLOBAL.*DEFAULT.*@@LIBOSTREE_' | sed -e 's,^.* \(ostree_[A-Za-z0-9_]*\)@@LIBOSTREE_[0-9_.]*,\1,' |sort -u > found-symbols.txt
+diff -u expected-symbols.txt found-symbols.txt
+echo "ok exports"
+
+# cmd__private__ is private.  The fetcher symbol should not have been made public.
+grep -E -v '(ostree_cmd__private__)|(ostree_fetcher_config_flags_get_type)' found-symbols.txt > expected-documented.txt
+
+echo "Verifying all public symbols are documented:"
+grep '^ostree_' ${G_TEST_SRCDIR}/apidoc/ostree-sections.txt |sort -u > found-documented.txt
+diff -u expected-documented.txt found-documented.txt
+
+echo 'ok documented symbols'